package com.freemyleft.left.left_app.mian.index.my.mywallet.share;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.freemyleft.left.left_app.R;
import com.freemyleft.left.left_app.R2;
import com.freemyleft.left.left_app.mian.index.my.mywallet.share.adapter.SharedAdapter;
import com.freemyleft.left.left_app.mian.index.my.mywallet.share.adapter.SharedConvert;
import com.freemyleft.left.zapp.delegates.LeftDelegate;
import com.freemyleft.left.zapp.ui.recycler.MultipleFields;
import com.freemyleft.left.zapp.ui.recycler.MultipleItemEntity;

import java.util.ArrayList;

import butterknife.BindView;

/**
 * 直接共享
 */
public class DirectShareDelegate extends LeftDelegate {
    @BindView(R2.id.recy)
    RecyclerView recyclerView;

    @Override
    public Object setLayout() {

        return R.layout.delegate_direct_share;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, @NonNull View rootView) {
        initData();
    }

    private void initData() {
        ArrayList<MultipleItemEntity> entities = new SharedConvert().convert();
        SharedAdapter adapter = new SharedAdapter(entities);
        recyclerView.setAdapter(adapter);
        LinearLayoutManager manager=new LinearLayoutManager(getContext());
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(manager);
    }
}
